

let ul=document.querySelector('.main ul')
let xhr=new XMLHttpRequest()
xhr.open('get','http://chst.vip:1234/api/getsitenav',true)
xhr.onload=function(){
    if(xhr.status===200){
        let res=JSON.parse(xhr.responseText)
        let an=res.result
        let lis=''
        console.log(an);
        an.forEach(item => {
            lis+=`
            <li>
                <a href="${item.navHref}">
                <img src="${item.navImg}">
                    <span>${item.navTitle}</span>
                </a>
            </li>
            `   
        });
        ul.innerHTML=lis
    }
}
xhr.send(null)